package com.hyt.it.ogt.kq.service.gov.model.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Chengxh
 * @since 2021-08-14
 */
@Data
@Accessors(chain = true)
@ApiModel(value="CandidateFileParam对象", description="考生文件参数对象")
public class CandidateParam {

    @ApiModelProperty(value = "考生id，添加考生不用传，修改考生时必传")
    private String id;

    @NotBlank(message = "考试任务id不能为空")
    @ApiModelProperty(value = "考试任务id(前端必传)")
    private String taskId;

    @ApiModelProperty(value = "报名省份(前端必传)")
    private String province;

    @ApiModelProperty(value = "报名城市(前端必传)")
    private String city;

    @ApiModelProperty(value = "报名区县(前端必传)")
    private String district;

    @Size(max = 10,message = "考生姓名长度不能大于10个字符串")
    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty(value = "姓名(前端必传)")
    private String name;

    @NotNull(message = "性别不能为空")
    @ApiModelProperty(value = "性别，1：男性，2：女性(前端必传)")
    private Integer sex;

    @NotNull(message = "证件类型不能为空")
    @ApiModelProperty(value = "证件类型(前端必传)")
    private Integer idType;

    @Size(max = 32,message = "证件号码长度不能大于32个字符串")
    @NotBlank(message = "证件号码不能为空")
    @ApiModelProperty(value = "证件号码(前端必传)")
    private String idNumber;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd" ,timezone="GMT+8")
    @ApiModelProperty(value = "出生日期(前端必传)")
    private String birthday;

    @ApiModelProperty(value = "考生照片全路径")
    private String photoPath;

    @ApiModelProperty(value = "考生照片文件名")
    private String photoName;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @Valid
    @NotEmpty(message = "报考科目不能为空")
    @ApiModelProperty(value = "报考科目List(前端必传)")
    private List<CandidateSubjectParam> subjects;

    @ApiModelProperty(value = "所属机构id")
    private String deptId;

    // 后续如果需要支持多种照片类型的话可以用这个参数
//    @ApiModelProperty(value = "考生文件参数(编辑考生时有变动就传，没变动不传)")
//    private List<CandidateFileParam> candidateFiles;

}
